package com.gongren.project.job.odd;

import com.alibaba.dubbo.config.annotation.Reference;
import com.gongren.project.odd.job.rpc.api.service.taskRpc.IBillAuditTaskRpcService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author houzhong
 * @Date 2017/9/1 10:34
 */
@Component("billAuditTask")
public class BillAuditTask {

    private static final Logger LOGGER = LoggerFactory.getLogger(BillAuditTask.class);

    @Reference
    private IBillAuditTaskRpcService billAuditTaskRpcService;


    //@Scheduled(cron = "* * */1 * * ?")
    public void autoBillAudit(){

        LOGGER.info("BillAuditTask and autoBillAudit start");
        try {
            billAuditTaskRpcService.findAllAutoBillAudit();

            LOGGER.info("BillAuditTask and autoBillAudit end");
        } catch (Exception e) {
            LOGGER.error("BillAuditTask and autoBillAudit：{}", e);
        }

    }
}
